import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const actions = {}

const mutations = {
    changeTheme (states) {
        console.log('changeTheme',states, states.theme,);
        states.currentIndex = (states.currentIndex + 1) % states.themeList.length;
        states.theme = states.themeList[states.currentIndex];  
    }
}

const state = {
    theme: 'chalk',
    themeList: ['chalk', 'vintage'],
    currentIndex: 0,
}

export default new Vuex.Store({
    actions,
    mutations,
    state
})